<template>
	<view class="">
		<u-navbar :is-back="true" title="假条" back-icon-color="#ffffff" title-color="#ffffff"
			:background="{backgroundColor:'#E62131'}"></u-navbar>
		<view class="" style="padding:0 30rpx;">
			<view class="toplsits">
				<image class="images" src="../../static/images/me.png" mode=""></image>
				<span class="names" v-if="datealObg.studentInfo">{{datealObg.studentInfo.name}}</span><span class="shengpi">{{datealObg.askStatus==0?'待审核':datealObg.askStatus==1?'审核通过':datealObg.askStatus==2?'审核拒绝':datealObg.askStatus==3?'作废':''}}</span>
			</view>
		</view>
		<view class="lsitcetext">
			<div class="textlios">请假类型 <span class="righttext">{{datealObg.askType==0?'病假':datealObg.askType==1?'事假':'其他'}}</span></div>
			<div class="textlios">请假课程 <span class="righttext" v-if="datealObg.workOut">{{datealObg.workOut.courseName}}</span></div>
			<div class="textlios">请假时间 <span class="righttext" v-if="datealObg.workOut">{{datealObg.workOut.classYear}}-{{datealObg.workOut.classDate}}</span></div>
			<div class="textlios">请假理由 <span class="righttext">{{datealObg.askContent}}</span></div>
			<div class="textlios">家长手机 <span class="righttext">{{datealObg.parentsPhone}}</span></div>
		</view>
		<view class="btnlsit">
			<view class="toptitles">
				给家长留言
			</view>
			<view class="listlisu">
				<image class="imagss" v-if="datealObg.askUserInfo && datealObg.askUserInfo.headImg" :src="datealObg.askUserInfo.headImg" mode=""></image>
				<image class="imagss" v-else  src="../../static/images/me.png" mode=""></image>
				<view class="right_titles">
					<view class="toptitlex">
						<span class="titlstnae" v-if="datealObg.askUserInfo">{{datealObg.askUserInfo.nickName}}</span> <span
							style="padding-left: 20rpx;">{{datealObg.askUserDate}}</span>
						<!-- <u-icon @click="modalactive(1)" name="more-dot-fill" color="#a7a7a7" size="60" ></u-icon> -->
					</view>
					<view class="textcenter">
						{{datealObg.askUserContent}}
					</view>
				</view>
				<!-- <view class="listListad" v-if="actives == index">
					<view class="uls">
						<view class="lis" @click="topages(item)">
							重新编辑
						</view>
						<view class="lis" style="border: none;" @click="removepalke">
							删除留言
						</view>
					</view>
				</view> -->
			</view>
			<view class="asdfss" @click="topages" v-if="!datealObg.askUserContent">
				<image class="issmagss"  src="../../static/images/me.png" mode=""></image>
				<view class="vbtnba">
					添加留言
				</view>
			</view>
		</view>
		<view class="bneads w-btn-fixed" v-if="!datealObg.askStatus">
			<div class="btnlst fliexs space_between">
				<view class="btn_left center" @click="okllists(3)">
					作废
				</view>
				<view class="btn_left center" @click="okllists(2)">
					不同意
				</view>
				<view class="btn_left right" @click="okllists(1)">
					同意
				</view>
			</div>
		
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:"",
				actives:null,
				datealObg:"",
			}
		},
		onLoad(option) {
			this.id = option.id
		},
		onShow() {
			this.studentaskDetailApi()
		},
		methods: {
			studentaskDetailApi(){
				uni.$api.common.studentaskDetail(this.id).then((res) => {
					this.datealObg = res.result
				});
			},
			topages() {
				uni.navigateTo({
					url: "./leaveMessage?type=" + 1 + '&id=' + this.id,
				})
			},
			okllists(askStatus){
				let objs = {
					id:this.id,
					askStatus 
				}
				uni.$api.common.studentaskeditAsk(objs).then((res) => {
					uni.showToast({
						title: "操作成功",
						icon: 'none'
					})
					setTimeout(() => {
						this.studentaskDetailApi()
					}, 1000)
				});
			},
		}
	}
</script>


<style lang="scss">
	.toplsits{
		border-bottom: 1rpx solid #e1e1e1;
		display: flex;
		align-items: center;
		padding:30rpx 0rpx;
		.images{
			width: 80rpx;
			height: 80rpx;
		}
		.names{
			font-weight: bold;
			font-size: 30rpx;
			padding: 0 16rpx;
		}
		.shengpi{
			display: inline-block;
			padding: 1rpx 4rpx;
			color: #E62131;
			border: 1rpx solid #E62131;
			border-radius: 5rpx;
		}
	}
	.lsitcetext{
		padding:  0 30rpx;
		.textlios{
			color: #b1b1b1;
			line-height: 60rpx;
			.righttext{
				padding-left: 18rpx;
				color: #000000;
			}
		}
	}
	.toptitlest{
		padding: 30rpx 0;
		border-bottom: 1rpx solid #e1e1e1;
		font-weight: bold;
		color: #000000;
		font-size: 26rpx;
	}
	.textlsit{
		padding-top: 20rpx;
		min-height: 150rpx;
	}
	.btnlst {
		// margin-top: 350rpx;
	
		.btn_left {
			width: 33%;
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			color: #b1b1b1;
			border: 1rpx solid #e1e1e1;
		}
	
		.right {
			background-color: #E62131;
			color: #ffffff;
		}
	}
	.btnlsit {
		padding: 40rpx 20rpx 80rpx;
	
		.toptitles {
			width: 100%;
			padding: 30rpx 0;
			border-bottom: 1rpx solid #f2f2f2;
			font-weight: bold;
		}
	
		.listlisu {
			display: flex;
			justify-content: space-between;
			margin-top: 30rpx;
			position: relative;
	
			.imagss {
				width: 50rpx;
				height: 50rpx;
			}
	
			.right_titles {
				width: 90%;
				margin-left: 20rpx;
	
				.toptitlex {
					display: flex;
					align-items: center;
					justify-content: space-between;
	
					.titlstnae {
						font-weight: bold;
						font-size: 26rpx;
					}
				}
	
				.textcenter {
					margin-top: 30rpx;
				}
			}
	
			.listListad {
				position: absolute;
				right: 100rpx;
				top: 20rpx;
				z-index: 9;
				text-align: center;
				background-color: #ffffff;
				border-radius: 5rpx;
	
				.uls {
					padding: 0 10rpx;
	
					.lis {
						padding: 30rpx 30rpx;
						border-bottom: 1rpx solid #e1e1e1;
					}
				}
			}
		}
	}
	.asdfss{
		display: flex;
		align-items: center;
		margin-top: 80rpx;
		.issmagss{
			width: 80rpx;
			height: 80rpx;
		}
		.vbtnba{
			width: 80%;
			padding: 20rpx 30rpx;
			background-color: rgba(230,33,49,0.3);
			margin-left: 10rpx;
			border-radius: 50rpx;
			color: #E62131;
		}
	}
</style>